import {Component, OnInit} from "@angular/core";
import {Router} from "@angular/router";
import {RoleService, Role} from "./role.service";
@Component({
    templateUrl: 'app/modules/role/html/role.list.html',
})
export class RoleListComponent implements OnInit {
    roles:Role[];

    constructor(private router:Router,
                private service:RoleService) {
    }

    onSelect(role:Role) {
        this.router.navigate(['/role', role.id]);
    }

    ngOnInit() {
        this.service.getRoles().then(roles => this.roles = roles);
    }

}